#include<iostream>
#include<vector>
#include<set>
using namespace std;

class Solution {
public:
    vector<int> intersection(vector<int>& nums1, vector<int>& nums2)
    {
        set<int> sn1, sn2;
        for (auto num : nums1)
        {
            sn1.insert(num);
        }
        for (auto num : nums2)
        {
            sn2.insert(num);
        }
        vector<int> res;
        for (auto ch : sn1)
        {
            auto it = sn2.find(ch);
            if (it != sn2.end())
                res.push_back(ch);
        }
        return res;

    }
};
int main()
{

    return 0;
}
